package TreeMap;

import java.util.Comparator;
import java.util.TreeMap;

public class test {
    public static void main(String[] args) {
        TreeMap<Integer,String> tm = new TreeMap<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                int i = o2 - o1;
                return i;
            }
        });
        tm.put(1,"奥利奥");
        tm.put(2,"雪碧");
        tm.put(4,"可口可乐");
        tm.put(3,"吃的");
        System.out.println(tm);
    }
}
